package rim;

import datatypes.r2.basic.AD;
import datatypes.r2.basic.CD;
import datatypes.r2.basic.CS;
import datatypes.r2.basic.ED;
import datatypes.r2.basic.EN;
import datatypes.r2.basic.II;
import datatypes.r2.basic.TEL;
import datatypes.r2.collectionsofquantities.QSET;
import datatypes.r2.flavors.INT_NONNEG;
import datatypes.r2.flavors.INT_POS;
import datatypes.r2.foundation.BL;
import datatypes.r2.foundation.COLL;
import datatypes.r2.foundation.DSET;
import datatypes.r2.foundation.LIST;
import datatypes.r2.quantities.RTO;
import datatypes.r2.quantities.TS;

/**
 * Definition of Role:
 * 
 * A competency of the Entity that plays the Role as identified, defined,
 * guaranteed, or acknowledged by the Entity that scopes the Role.
 * 
 * 一个扮演的角色的实体认定为能力，定义，保证或实体的承认范围的作用。
 * 
 * 
 * UsageNotes:
 * 
 * An Entity participates in an Act in the guise of a particular Role. Note that
 * a particular entity in a particular role can participate in an act in
 * different ways. Thus, a Person in the role of a practitioner can participate
 * in a patient encounter as a rounding physician or as an attending physician.
 * The Role defines the competency of the Entity irrespective of any Act, unlike
 * Participations, which are limited to the scope of an Act.
 * 
 * Each role is "played" by one Entity, called the "player" and is "scoped" by
 * another Entity, called the "scoper". Thus the Role of "patient" may be played
 * by a person and scoped by the provider organization from which the patient
 * will receive services. Similarly, the employer scopes the "employee" role.
 * 
 * The identifier of the Role identifies the Entity playing the role in that
 * role. This identifier is assigned by the scoper to the player. The scoper
 * NEED NOT have issued the identifier, but MAY have re-used an existing
 * identifier.
 * 
 * Most attributes of Role are attributes of the playing entity while in the
 * particular role.
 * 
 * 一个实体参与了一项法令，在一个特定的角色为名。请注意，特别是在一个特定的角色实体可以参与在以不同的方式行为。因此，一个人在一个医生的角色，
 * 可以参加在病人的遭遇作为四舍五入医师或主治医师。角色定义实体的能力，无论任何法令，不同于参与，这是限制法“的范围。
 * 
 * 每个角色“扮演”一个实体，称为“玩家”和另一实体称为“scoper”，是“范围”。因此，“病人”的角色，可发挥一个人，从哪个病人会收到服务提供商组织的范围
 * 。同样的，用人单位范围的“雇员”的角色。
 * 
 * 角色的标识符标识的实体，发挥这一作用的角色。此标识符分配球员scoper。在scoper需要没有发行的标识，但可能重新使用现有的标识符。
 * 
 * 大多数属性的角色，而在特定的角色扮演实体的属性。
 * 
 * @author Obama
 * 
 */
public class Role extends InfrastructureRoot {

	private static final long serialVersionUID = 1L;

	/**
	 * Definition: The major class of Role to which a Role-instance belongs.
	 * 
	 * 定义： 主要角色类属于角色的实例。
	 * 
	 * This attribute provides a tightly controlled vocabulary of Role class
	 * "types" that is balloted with the RIM, and can be used to represent a
	 * type enumeration that might have been represented as a physical class in
	 * the RIM, but was not because while it had unique meaning, it did not
	 * require unique attributes or unique patterns of associations. The "code"
	 * attribute defines a specific sub-type of this Role type, and is intended
	 * to allow use of rich terminologies to represent these sub-types.
	 * 
	 * 此属性提供了一个严格控制的作用类“类型”，即抽签与RIM，可以用来表示可能已作为在RIM的体育课代表的一个类型枚举的词汇，
	 * 但不会是因为虽然它具有独特的也就是说，它并不需要独特属性或协会的独特模式。
	 * “代码”属性定义此角色类型特定的分型，是为了让丰富的术语来代表这些子类型。
	 */
	private CS classCode;
	/**
	 * Definition: A unique identifier for the player Entity in this Role.
	 * 
	 * 一个球员在这个角色实体的唯一标识符。
	 */
	private DSET<II> id;
	/**
	 * Definition: The specific kind of Role to which an Role-instance belongs.
	 * 
	 * 一个角色实例属于一种特定的角色。
	 * 
	 * 
	 * UsageConstraint:
	 * 
	 * Role.code must conceptually be a proper specialization of Role.classCode.
	 * 
	 * role.code概念必须是适当的Role.classCode专业化。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * Role.code does not modify Role.classCode. Rather, each is a complete
	 * concept or a Role-like relationship between two Entities, but Role.code
	 * may be more specific than Role.classCode.
	 * 
	 * This attribute defines a specific sub-type of a given Role type
	 * (determined by the "classCode" attribute). It allows the use of rich
	 * terminologies to represent sub-types of the limited set of Role types
	 * defined by "classCode."
	 * 
	 * role.code并不修改Role.classCode的。相反，每一个完整的概念或两个实体之间的角色关系，，但Role.code可能会更比Role
	 * .classCode具体。
	 * 
	 * 该属性定义一个特定的子类型的一个给定的角色类型（由“classCode”的属性决定）。它可以利用丰富的用语来表示有限集所定义的角色类型的子类型“
	 * classCode。”
	 */
	private CD code;
	/**
	 * Definition: An indicator specifying that the Role is a competency that is
	 * specifically not attributed to the Entity playing the Role.
	 * 
	 * 定义： 指定的角色是一个专门扮演的角色归结为实体的能力的一个指标。
	 * 
	 * 
	 * Examples:
	 * 
	 * 1) This Person is not our Employee
	 * 
	 * 2) This Mouthwash does not have Alcohol as an ingredient.
	 * 
	 * 1）这个人是不是我们的员工
	 * 
	 * 2）本漱口水不具备作为原料的酒精。
	 */
	private BL negationInd;
	/**
	 * Definition: A non-unique textual identifier or moniker for the playing
	 * Entity intended for use principally when playing the Role.
	 * 
	 * 用于扮演的角色时，主要使用非唯一的文本标识符或打实体的绰号。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * In general, names are specified using Entity.name. Role.name is only used
	 * when the standard wishes to distinguish names that are appropriate for
	 * use when referring to the Entity in one Role as opposed to other Roles..
	 * 
	 * 在一般情况下，指定名称使用Entity.name。
	 * Role.name仅用于标准时，要区分是指实体中的一个角色，而不是其他角色时，使用适当的名称......
	 * 
	 * 
	 * Examples:
	 * 
	 * Names used as an employee, as a licensed professional, etc.
	 * 
	 * 作为雇员的名字，作为一个持牌的专业人士，等
	 */
	private COLL<EN> name;
	/**
	 * Definition: A postal address for the Entity while in the Role.
	 * 
	 * 一个实体中的作用，而邮政地址。
	 */
	private COLL<AD> addr;
	/**
	 * Definition: A telecommunication address for the Entity while in the Role.
	 * 
	 * 一个实体中的作用时的通讯地址。
	 */
	private COLL<TEL> telecom;
	/**
	 * Definition: The state of this Role as defined in the state-transition
	 * model.
	 * 
	 * 这个角色的状态，在状态转换模型的定义。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * This attribute was defined in the original RIM as repeating, owing to the
	 * presence of nested states in the state machines. In practice, however,
	 * there is never a need to communicate more than a single status value.
	 * Therefore, committees are advised to constrain this attribute to a
	 * maximum cardinality of 1 in all message designs.
	 * 
	 * 这个属性被定义在原RIM重复，由于存在嵌套状态机状态。然而，在实践中，从来都不是需要沟通，多一个状态值。因此，
	 * 委员会建议在所有的消息设计的最大基数为1来约束这个属性。
	 */
	private CS statusCode;
	/**
	 * Definition: An interval of time specifying the period during which the
	 * Role is in effect, if such time limit is applicable and known.
	 * 
	 * 期间指定的时间间隔，在此期间的作用效果，如果是在这样的时间限制是适用的和已知的。
	 */
	private QSET<TS> effectiveTime;
	/**
	 * Definition: A textual or multimedia depiction of a certificate issued by
	 * the scoping Entity of a Role certifying that this Role is indeed played
	 * by the player Entity.
	 * 
	 * 一个文字或多媒体的描述，这个角色确实是由球员实体扮演的角色，证明的范围实体签发的证书。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * The certificate subject is the Entity that plays the Role. The
	 * certificate issuer is the Entity that scopes the Role. The certificate
	 * can be represented in many different ways, either inline or by reference,
	 * according to the ED data type.
	 * 
	 * 凭证的主体是实体，扮演的角色。证书颁发者是实体范围的作用。该证书可以代表许多不同的方式，无论是内嵌或参考，根据海关的数据类型。
	 * 
	 * 
	 * Examples:
	 * 
	 * Paper-based certificate: a document or file that can be retrieved through
	 * an electronic interface to a hardcopy archive.
	 * 
	 * Electronic certificate: this attribute can represent virtually any
	 * electronic certification scheme, such as an electronically (including
	 * digitally) signed electronic text document.
	 * 
	 * Digital certificate (public key certificate): in particular, this
	 * attribute can represent digital certificates, as an inline data block or
	 * by reference to such data. The certificate data block would be
	 * constructed in accordance to a digital certificate standard, such as
	 * X509, SPKI, PGP, etc.
	 * 
	 * 纸张为基础的证书：硬拷贝存档的电子接口，可以通过检索的文档或文件。
	 * 
	 * 电子证书：这个属性可以表示几乎所有的电子认证计划，如电子签名的电子文本文件（包括数字）。
	 * 
	 * 数字证书（公钥证书）：特别是，这个属性可以代表数字证书，作为联的数据块或参考这些数据。证书的数据块，将按照构建数字证书标准，如的X509，SPKI
	 * ，PGP等。
	 */
	private ED certificateText;
	/**
	 * Definition: Constraints around appropriate disclosure of information
	 * about this Role.
	 * 
	 * 周围合适这个角色的信息披露的约束。
	 */
	private CD confidentialityCode;
	/**
	 * Definition: A ratio (numerator : denominator) where the numerator
	 * specifies the amount of the Entity playing the Role and the denominator
	 * specifies the amount of the Entity scoping the Role. Thus, the ratio
	 * specifies the relative amount of the "contained" entity in the
	 * "containing" entity.
	 * 
	 * 分子指定扮演的角色和分母的实体金额的比率（分子：分母）指定的实体的范围量的作用。因此，这个比例指定“所载的”实体“包含”实体的相对量。
	 * 
	 * 
	 * 
	 * UsageConstraint:
	 * 
	 * Used for Roles that represent composition relationships between the
	 * scoping and playing Entities. Restrict class codes that are members of
	 * value set RoleClassPartitive (2.16.840.1.113883.1.11.10429)
	 * 
	 * 用于代表的范围和玩实体之间的组成关系的角色。限制类代码，值集RoleClassPartitive的成员（2.16.840.1.113883.1
	 * .11.10429）
	 * 
	 * 
	 * UsageConstraint:
	 * 
	 * The units of numerator and denominator should make sense for the
	 * Entity.code and Material.formCode attributes of the playing and scoping
	 * entities. Usually these will be either unitless (e.g. 10 people in 1
	 * committee) or will represent mass, amount-of-substance or volume. The
	 * units of the numerator and denominator need not be the same. E.g. 10mg
	 * per 5mL.
	 * 
	 * 分子和分母的单位应为演奏和范围的实体E​​ntity.code和Material.formCode属性的意义。通常情况下，这些将是或者无单位（
	 * 如1委员会10人），或将代表质量，数量的物质或体积。分子和分母的单位不必是相同的。例如每5毫升10毫克。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * The ratio always represents a relative quantity. I.e. a Role.quantity of
	 * 5mg per 10mL never implies that there is exactly 5mg of the player or
	 * 10mL of the scoper. The exact quantities of the Entities must be
	 * determined by examining Entity.quantity, or the participation or Act
	 * quantity attributes referencing the scoping Entity. For example, if the
	 * SubstanceAdministration.doseQuantity is "5mL" with a consumable of a
	 * syrup entity having an active ingredient role with a quantity of 5mg per
	 * 10mL, then the Act is dealing with 5mL of syrup containing 2.5mg of the
	 * active ingredient.
	 * 
	 * 比例始终代表一个相对的数量。即每毫升5毫克Role.quantity从未暗示有球员或scoper的10ML正是5毫克。通过的研究Entity.
	 * quantity，或参与或法令的数量属性参考范围的实体必须确定实体的确切数量。例如，如果SubstanceAdministration.
	 * doseQuantity是“5ML”以每毫升5毫克的数量与活性成分作用的药水实体消耗，那么该法处理含活性成分的每公升2.5毫克糖浆5毫升。
	 * 
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * In composition-relationships (e.g., has-parts, has-ingredient,
	 * has-content) the Role.quantity attribute specifies that a numerator
	 * amount of the target entity is comprised by a denominator amount of the
	 * source entity of such composition-relationship. For example, if a box
	 * (source) has-content 10 eggs (target), the relationship quantity is 10:1;
	 * if 0.6 mL contain 75 mg of FeSO4 the ingredient relationship quantity is
	 * 75 mg : 0.6 mL. Both numerator and denominator must be amount quantities
	 * (extensive quantities, i.e., a count number, mass, volume, amount of
	 * substance, amount of energy, etc.).
	 * 
	 * 在组成的关系（例如，有部分，有成分，有内容）Role.quantity属性指定的目标实体的分子量分母金额由源等组成的关系实体组成。例如，如果一个框
	 * （源）有10个鸡蛋（目标），含量的关系数量是10:1;
	 * 0.6毫升含有75毫克硫酸亚铁成分关系的数量是75毫克，0.6毫升。分子和分母必须是金额数量（数量，即广泛，数数，质量，体积，物质的量，能量等）。
	 * 
	 * 
	 * Examples:
	 * 
	 * 1) This syrup's (scoper) ingredients include 160 mg (numerator)
	 * Acetaminophen (player) per tablespoon (denominator).
	 * 
	 * 2) This herd (scoper) consists of 500 (numerator) cattle (player).
	 * 
	 * 3) This package (scoper) contains 100 (numerator) pills (player).
	 * 
	 * 4) This tablet (scoper) contains 500 mg (numerator) acetylsalicylic acid
	 * (player).
	 * 
	 * 1）这糖浆（scoper）成分，包括160毫克每汤匙（分母）（分子）对乙酰氨基酚（播放器）。
	 * 
	 * 2）牛群（scoper）由500牛（分子）（播放器）。
	 * 
	 * 3）包（scoper）包含100丸（分子）（播放器）。
	 * 
	 * 4）此片（scoper）含有500毫克（分子）乙酰水杨酸（球员）。
	 */
	private RTO quantity;
	/**
	 * Definition: An integer specifying the relative preference for considering
	 * this role instance before other like-typed Roles (same classCode and
	 * code) having the same scoper. Roles with lower priorityNumber values are
	 * considered before and above those with higher values.
	 * 
	 * 一个整数，指定相对优先考虑这个角色的实例之前，其他类似类型的角色（相同classCode和代码）有相同的scoper。
	 * 较低priorityNumber值的角色被认为是前及以上更高的价值。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * Applicable only when considering playing entities with respect to a
	 * particular scoping entity. It has no meaning in other circumstances.
	 * Among alternatives or options that are being chosen by humans, the
	 * priorityNumber specifies preference. The ordering may be a total
	 * ordering, in which all priority numbers are unique, or a partial
	 * ordering, in which the same priority may be assigned to more than one
	 * role.
	 * 
	 * 适用时才考虑打一个特定范围的实体的实体。它在其他情况下没有意义。之间的替代品或正在被人类的选择，priorityNumber指定偏好。
	 * 订货会的总排序，在所有优先号码是独一无二的，或偏序，在相同的优先级可能被分配到一个以上的角色。
	 */
	private INT_POS priorityNumber;

	/**
	 * Definition: An integer specifying the position of the Entity playing the
	 * Role with respect to the Entity that scopes the Role.
	 * 
	 * 一个整数，指定实体方面发挥作用，作用范围的实体位置。
	 * 
	 * 
	 * UsageNotes:
	 * 
	 * This attribute is primarily used with containment roles. For example,
	 * some containers have discrete positions in which content may be located.
	 * Depending on the geometry of the container, the position may be
	 * referenced as a scalar ordinal number, or as a vector of ordinal numbers
	 * (coordinates). Coordinates always begin counting at 1.
	 * 
	 * Some containers may have customary ways of referring to the positions;
	 * some have no way at all. In the absence of any specific regulation for a
	 * specific container type, the rule of thumb is that the coordinate that is
	 * changed first is positioned first. For an automated blood chemistry
	 * analyzer with a square shaped tray, this means that the first coordinate
	 * represents the direction the tray moves at each step, while the second
	 * coordinate represents the direction in which the tray moves only
	 * periodically.
	 * 
	 * 这个属性主要是用来遏制作用。例如，一些容器中的内容可能位于离散位置。根据容器的几何形状，位置可能会被引用，作为一个标序号，或作为载体的序数（坐标）
	 * 。坐标总是从1开始计数。
	 * 
	 * 一些容器可能有习惯的方式指的位置，有没有办法在所有。在任何一个特定的容器类型的具体规定的情况下，经验法则是第一，首先改变的坐标定位。
	 * 与方形托盘自动血液生化分析仪，这意味着第一个坐标代表托盘移动的每一步，而第二个坐标代表的托盘移动方向，只有定期的方向。
	 */
	private LIST<INT_NONNEG> positionNumber;

	private Entity player;

	private Entity scoper;

	public CS getClassCode() {
		return classCode;
	}

	public void setClassCode(CS classCode) {
		this.classCode = classCode;
	}

	public DSET<II> getId() {
		return id;
	}

	public void setId(DSET<II> id) {
		this.id = id;
	}

	public CD getCode() {
		return code;
	}

	public void setCode(CD code) {
		this.code = code;
	}

	public BL getNegationInd() {
		return negationInd;
	}

	public void setNegationInd(BL negationInd) {
		this.negationInd = negationInd;
	}

	public COLL<EN> getName() {
		return name;
	}

	public void setName(COLL<EN> name) {
		this.name = name;
	}

	public COLL<AD> getAddr() {
		return addr;
	}

	public void setAddr(COLL<AD> addr) {
		this.addr = addr;
	}

	public COLL<TEL> getTelecom() {
		return telecom;
	}

	public void setTelecom(COLL<TEL> telecom) {
		this.telecom = telecom;
	}

	public CS getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(CS statusCode) {
		this.statusCode = statusCode;
	}

	public QSET<TS> getEffectiveTime() {
		return effectiveTime;
	}

	public void setEffectiveTime(QSET<TS> effectiveTime) {
		this.effectiveTime = effectiveTime;
	}

	public ED getCertificateText() {
		return certificateText;
	}

	public void setCertificateText(ED certificateText) {
		this.certificateText = certificateText;
	}

	public CD getConfidentialityCode() {
		return confidentialityCode;
	}

	public void setConfidentialityCode(CD confidentialityCode) {
		this.confidentialityCode = confidentialityCode;
	}

	public RTO getQuantity() {
		return quantity;
	}

	public void setQuantity(RTO quantity) {
		this.quantity = quantity;
	}

	public INT_POS getPriorityNumber() {
		return priorityNumber;
	}

	public void setPriorityNumber(INT_POS priorityNumber) {
		this.priorityNumber = priorityNumber;
	}

	public LIST<INT_NONNEG> getPositionNumber() {
		return positionNumber;
	}

	public void setPositionNumber(LIST<INT_NONNEG> positionNumber) {
		this.positionNumber = positionNumber;
	}

	public Entity getPlayer() {
		return player;
	}

	public void setPlayer(Entity player) {
		this.player = player;
	}

	public Entity getScoper() {
		return scoper;
	}

	public void setScoper(Entity scoper) {
		this.scoper = scoper;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

}
